﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GenericGA.reader.tree
{
    /// <summary>
    /// An abstract factory to create nodes for trees which are read via a reader object. This is used to allow the user to describe how to structure the tree to be read.
    /// </summary>
    /// <typeparam name="N">The abstract type of every node in the tree.</typeparam>
    public interface INodeFactory<N>
    {

        /// <summary>
        /// The factory method which is to create a node based on a reader object and the children it is to join together.
        /// </summary>
        /// <param name="children">The children of the node.</param>
        /// <param name="reader">A reader object to obtain other values.</param>
        /// <returns>A node for the tree being read.</returns>
        N CreateNode(List<N> children, Reader reader);

    }
}
